<?php include('./templete/public/head.php') ?>

<body class="bgcolor">


<!--提议详情-->
<div class="golden-idea-detail tiyi-detail">
    <!--时间进展-->
    <div class="ideal-detail3">
        <p class="title">任务列表</p>
        <ul class="detail3-list">
            <?php foreach ($list as $v) { ?>
                <li class="list-item">
                    <a onclick="showmessage('<?php echo $v['content'] ?>','<?php echo $v['complete_content']?>')">
<!--                        <img src="--><?php //echo $v['user_head'] ?><!--" class="head-img"/>-->
                        <div class="item-text">
                            <p class="p1 clearfix">
                                <span class="fl"><?php echo get_user_info($v['user_id'])['name'] ?></span>
                                <span class="fr"><?php echo date('m-d h:i', strtotime($v['add_time'])) ?></span>
                            </p>
                            <p class="p2"><?php switch ($v['status']){
                                    case 0:
                                        echo '接受任务';
                                        break;
                                    case 1:
                                        echo '确认任务';
                                        break;
                                    case 2:
                                        echo '完成任务';
                                        break;
                                    case 3:
                                        echo '否定任务';
                                        break;
                                } ?></p>
                        </div>
                    </a>
                </li>
            <?php } ?>
        </ul>
        <div class="detail2-btn comm-btn comm-btn2">
            <span class="color1 sure">完成确认</span>
        </div>
    </div>
</div>
</body>
</html>
<script>
    function showmessage(content,complete_content) {

            layer.open({
                type: 1,
                title: '任务详情',
                area: ['70%', '250px'], //宽高
                content: content,
                shade: [0.5, '#000']
            });
    }
    $('.sure').click(function () {
        $.ajax({
            url:"<?php echo url('finish_confirm')?>",
            data:{
                id:<?php echo $list[0]['jdz_id']?>
            },
            success:function (data) {
                layer.msg(data.msg);
                setTimeout(function () {
                    location.href="<?php echo url('detail',['id'=>$list[0]['jdz_id']])?>"
                },1000)
            }
        })
    })

</script>
